# Start Example, just copy and paste
data(Oats, package = "MEMSS") 
tp1.oats <- xyplot(yield ~ nitro | Variety + Block,
		      data = Oats,
		      panel = function(x, y, subscripts, ...) {	
				# How to normalize my heatmap metric with
				# the value of the panel that has maximum average ?
				# metric = eval(mean(y)/ max(<mean-of-each-panel>))))) 
				metric = eval(mean(y)/max(Oats$yield))
				panel.fill(col = rgb(metric, 0, 0))
				panel.lines(x,y)
			  }
			)
print(tp1.oats)
# End Example